﻿using System;
using Microsoft.Xna.Framework;

namespace CellarDoor.Gui.Elements
{
    public class UiMenuItem : UiElement
    {
        private UiContextMenu subMenu;

        public UiContextMenu SubMenu
        {
            get { return subMenu; }
        }

        /// <summary>
        /// Creates a button element
        /// </summary>
        public UiMenuItem()
            : base()
        {
            Initialize();
        }

        /// <summary>
        /// Creates a button element
        /// </summary>
        public UiMenuItem(UiElement parent)
            : base(parent)
        {
            Initialize();
        }

        private void Initialize()
        {
            this.subMenu = new UiContextMenu(this);
            this.subMenu.Visible = false;
            this.subMenu.Width = 100;
            this.subMenu.Height = 200;
            this.Style = new Gui.Layout.UiVisualStyleWithState(this);

            ElementName = "MenuItem";
            Width = 50;
            Height = 20;
            Margin = new UiPadding(2, 2, 2, 2);
        }
    }
}
